//
//  EOCSmithPerson.m
//  Test
//
//  Created by 杨德龙 on 2017/6/1.
//  Copyright © 2017年 HipalSports. All rights reserved.
//

#import "EOCSmithPerson.h"

@implementation EOCSmithPerson


/**
 子类重写了 父亲类的 方法

 @param lastName lastName description
 */
- (void)setLastName:(NSString *)lastName
{
    if (![lastName isEqualToString:@"Smith"]) {
        [NSException raise:NSInvalidArgumentException format:@"Last name must be Smith"];
    }
    self.lastName=lastName;
}


- (void)setFirstName:(NSString *)firstName
{
    if (![firstName isEqualToString:@"Smith"]) {
        [NSException raise:NSInvalidArgumentException format:@"first name must be Smith"];
    }
    self.firstName=firstName;
}

@end
